/*
 * Copyright 2009 Jamie Gennis
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.code.gwt.remoteaction.client;

import com.google.gwt.user.client.rpc.IsSerializable;
import java.util.ArrayList;
import java.util.Set;

/**
 * The interface to test service A.
 * 
 * @author jgennis
 */
public interface ServiceA extends RemoteActionService {

  @RemoteAction(ActionA.class)
  public void methodA();

  @RemoteAction(ActionB.class)
  public int methodB();

  @RemoteAction(ActionC.class)
  public Integer methodC(int a);

  @RemoteAction(ActionD.class)
  public void methodD(boolean a) throws ExceptionD;

  @RemoteAction(ActionE.class)
  public void methodE(Set<Integer> integers) throws ExceptionE;

  @RemoteAction(ActionF.class)
  public ArrayList<Float> methodF();

  @RemoteAction(ActionG.class)
  public ObjectG methodG();

  public static class ActionA implements Action {
  }

  public static class ActionB implements Action {
  }

  public static class ActionC implements Action {

    protected int a;

    @SuppressWarnings("unused")
    private ActionC() {
    }

    public ActionC(int a) {
      this.a = a;
    }

    public int getA() {
      return a;
    }
  }

  public static class ActionD implements Action {

    protected boolean a;

    @SuppressWarnings("unused")
    private ActionD() {
    }

    public ActionD(boolean a) {
      this.a = a;
    }

    public boolean getA() {
      return a;
    }
  }

  public static class ExceptionD extends Exception implements IsSerializable {
  }

  public static class ActionE implements Action {

    public Set<Integer> integers;

    @SuppressWarnings("unused")
    private ActionE() {
    }

    public ActionE(Set<Integer> integers) {
      this.integers = integers;
    }
  }

  public static class ExceptionE extends RuntimeException implements IsSerializable {

    @SuppressWarnings("unused")
    private ExceptionE() {
    }

    public ExceptionE(String string) {
      super(string);
    }
  }

  public static class ActionF implements Action {
  }

  public static class ActionG implements Action {
  }

  public static class ObjectG implements IsSerializable {
  }
}
